import { defineStore } from 'pinia'

interface IGlobalState {
	isLeftCollapse: boolean
	isRightCollapse: boolean
}

export const useGlobalStore = defineStore({
	id: 'global-config',
	// 修改默认值之后，需清除 localStorage or sessionStorage 数据
	state: (): IGlobalState => ({
		isLeftCollapse: false,
		isRightCollapse: false
	}),
	getters: {},
	actions: {
		toggleLeftCollapse() {
			this.isLeftCollapse = !this.isLeftCollapse
		},
		toggleRightCollapse() {
			this.isRightCollapse = !this.isRightCollapse
		}
	}
})
